#!/usr/bin/gnuplot

#set terminal post eps 24
set terminal post eps color 24

# cpu 
set output "cpu.eps"
set xlabel "time "
set ylabel "CPU perceptage (%)"
set yrange [0:100]
set xrange [0:200]

plot "job4011.dat" using 1:6 with filledcurves lt 1 linecolor 1 title "job4011", \
"job4010.dat" using 1:6 with filledcurves lt 1 linecolor 2 title "job4010", \
"tasktracker.dat" using 1:6 with filledcurves lt 1 linecolor 3 title "tasktracker", \
"datanode.dat" using 1:6 with filledcurves lt 1 linecolor 4 title "datanode", \
"host.dat" using 1:6 with filledcurves lt 1 linecolor 5 title "total"

# cpu (filledcurves) 
set output "cpuf.eps"
set xlabel "time "
set ylabel "CPU perceptage (%)"

plot "cpu.dat" using 1:2 with filledcurves lt 1 linecolor 1 title "job4011", \
"cpu.dat" using 1:2:3 with filledcurves lt 1 linecolor 2 title "job4010", \
"cpu.dat" using 1:3:4 with filledcurves lt 1 linecolor 3 title "tasktracker", \
"cpu.dat" using 1:4:5 with filledcurves lt 1 linecolor 4 title "datanode", \
"cpu.dat" using 1:5:6 with filledcurves lt 1 linecolor 5 title "total"


# read bytes (KB) 
set output "rb.eps"
set xlabel "time"
set ylabel "read bytes (KB/s)"

plot "job4011.dat" using 1:2 with filledcurves lt 1 linecolor 1 title "job4011", \
"job4010.dat" using 1:2 with filledcurves lt 1 linecolor 2 title "job4010", \
"tasktracker.dat" using 1:2 with filledcurves lt 1 linecolor 3 title "tasktracker", \
"datanode.dat" using 1:2 with filledcurves lt 1 linecolor 4 title "datanode", \
"host.dat" using 1:2 with filledcurves lt 1 linecolor 5 title "total"

